package com.mallcai.bigdata.ladon.service.peekdata;

import com.mallcai.bigdata.ladon.dpl.entity.peekdata.PeekField;

import java.util.List;

/**
 * @author feixy
 * @version 1.0
 * @date 2019-07-08 17:01
 */
public interface IPeekFieldService {

    /**
     * 保存记录
     * @param peekField
     * @return
     */
    int save(PeekField peekField);

    /**
     * 批量保存
     * @param peekFieldList
     * @return
     */
    default int saveList(List<PeekField> peekFieldList){
        return peekFieldList.stream().mapToInt(this::save).sum();
    }

    /**
     * 删除指定id的记录
     * @param id
     * @return
     */
    int deleteById(Long id);

    /**
     * 删除指定取数下的所有记录
     * @param peekId
     * @return
     */
    int deleteByPeekId(Long peekId);

    /**
     * 获取指定取数id下的所有字段
     * @param peekId
     * @return
     */
    List<PeekField> getByPeekId(Long peekId);
}
